﻿@using Seal.Model
@using Seal.Helpers
@{
    ReportView view = Model;
    Report report = view.Report;
    Repository repository = report.Repository;
}

<!-- status-->
<div id="alert_status">
    @if (report.Cancel)
    {
        <div class="alert alert-danger" role="alert">
            @Raw(Helper.ToHtml(report.Translate("Report has been cancelled")))
        </div>
    }
    @if (!string.IsNullOrEmpty(report.WebExecutionErrors))
    {
        <div class="alert alert-danger" role="alert">
            @Raw(Helper.ToHtml(report.WebExecutionErrors))
        </div>
    }
    <div id="view_result_message" class='alert alert-warning alert-dismissible hidden' role='alert'>
        @Raw(Helper.ToHtml(report.Translate("Please wait, the report result is being generated in another window")))...
    </div>
</div>

<!--progress-->
<div id="progress_panel" class="panel panel-default hidden">
    <div class="panel-body" style="padding-bottom:0px;">
        <div class="progress hidden">
            <div id="progress_bar" class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%;">
            </div>
        </div>
        @if (report.ExecutionTasks.Count > 0)
        {
            <div class="progress hidden">
                <div id="progress_bar_tasks" class="progress-bar progress-bar-primary progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%;">
                </div>
            </div>
        }
        @if (report.ExecutionModels.Count > 0)
        {
            <div class="progress hidden">
                <div id="progress_bar_models" class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%;">
                </div>
            </div>
        }
    </div>
</div>

@if (!report.PrintLayout) {
    <div class="tab-content">
        @Include(view.GetPartialTemplateKey("Report.iInformation", view), view)
        @Include(view.GetPartialTemplateKey("Report.iMessages", view), view)
        @Include(view.GetPartialTemplateKey("Report.iViews", view), view)
    </div>

}
else {
    <div class="tab-content">
        @Include(view.GetPartialTemplateKey("Report.iViews", view), view)
        @Include(view.GetPartialTemplateKey("Report.iInformation", view), view)
        @Include(view.GetPartialTemplateKey("Report.iMessages", view), view)
    </div>
}